package com.ruoyi.wms.domain.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.wms.domain.entity.MailboxAddress;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.excel.annotation.ExcelDictFormat;
import com.ruoyi.common.excel.convert.ExcelDictConvert;
import lombok.Data;
import io.github.linpeilie.annotations.AutoMapper;

import java.io.Serializable;
import java.io.Serial;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 填写地配置视图对象 mailbox_address
 *
 * @author zcc
 * @date 2024-12-14
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = MailboxAddress.class)
public class MailboxAddressVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @ExcelProperty(value = "")
    private Long id;

    /**
     * 父级id
     */
    @ExcelProperty(value = "父级id")
    private Long parentId;

    /**
     * 等级（区，乡镇，村社区）
     */
    @ExcelProperty(value = "等级", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "区=，乡镇，村社区")
    private Long level;

    /**
     * 编号
     */
    @ExcelProperty(value = "编号")
    private String code;

    /**
     * 名称
     */
    @ExcelProperty(value = "名称")
    private String name;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    /**
     * 排序
     */
    @ExcelProperty(value = "排序")
    private Long orderNum;

    private LocalDateTime createTime;

    @TableField(exist = false)
    private List<MailboxAddressVo> children = new ArrayList<MailboxAddressVo>();

}
